import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/test'
  },
  {
    path: '/door',
    name: 'door',
    component: () => import('@/views/door/door.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/login.vue')
  },
  {
    path: '/test',
    name: 'test',
    component: () => import('@/views/test/test.vue')
  },
  {
    path: '/system',
    name: 'system',
    component: () => import('@/views/system/system.vue'),
    //
    children: [
      {
        path: '/system/user',
        name: 'user',
        component: () => import('@/views/system/user/user.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
